package com.guandi.geekbrowser.primary.service;

import com.guandi.geekbrowser.primary.entity.Details;
import com.guandi.geekbrowser.primary.entity.Ipool;
import org.springframework.data.domain.Page;

import java.util.List;

public interface IpoolService {
    List<Ipool> findByUserIdAndUsestatus(String id, Integer use);

    Ipool saveIpool(Ipool ipool);

    List<Ipool> saveAll(List<Ipool> ipools);

    List<Ipool> findAll();

    Ipool findByUserIdAndAddressAndPort(String id, String address, String port);

    List<Ipool> findByUserIdAndUsestatusAndTypeOrderByPortAsc(String id, Integer use,Integer type);

    Ipool findByAddressAndPort( String address, String port);

    Ipool findByAddressAndPortAndUserId(String address, String port, String userId);

    List<Ipool> findByUserIdAndUsestatusAndType(String id, Integer use,Integer type);

    Integer updateType(Long id, Integer type);

    Integer updateUsestatus(Long id, Integer usestatus);

    List<Ipool> findByUserIdAndType(String id,Integer type);

    Page<Ipool> findByUserIdAndTypePage(String id, Integer type,int pageSize,int pageNumber);

    Page<Ipool> findByUserIdAndTypeAndCountryPage(String id, Integer type,int pageSize,int pageNumber,String country);

    Ipool findByUserIdAndId(String userId, Long id);

    void deleteByIdAndUserId(Long id, String userId);

    List<Ipool> findByUserIdAndUsestatusAndCountry(String id, Integer use,String country);

    Ipool findByAddressAndPortAndUserIdAndCountry(String address, String port,String userId,String country);

    Page<Ipool> findByUserIdUseStatusTypeCountryBindOrderByPortASCPage(String userId, Integer use,Integer bind,Integer type,String country);

    List<Ipool> findByUserIdUseStatusTypeCountryBindOrderByPortASC(String userId, Integer use,Integer bind,Integer type,String country);

    Ipool findByUserIdAndTypeQuery(String userId,Integer type);

    List<Ipool> findByCountryAndType(String country, Integer type);

}
